<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://www.springframework.org/security/tags" prefix="security" %>

<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>工程施工实时监控系统</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">


    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <!--<link rel="stylesheet" href="${pageContext.request.contextPath}/${pageContext.request.contextPath}/${pageContext.request.contextPath}/plugins/timepicker/bootstrap-timepicker.min.css">-->
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <%--<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>--%>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>


    <!--<script src="${pageContext.request.contextPath}/${pageContext.request.contextPath}/${pageContext.request.contextPath}/plugins/timepicker/bootstrap-timepicker.min.js"></script>-->

    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/iCheck/square/blue.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/morris/morris.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/datepicker/datepicker3.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.theme.default.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/select2/select2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.skinNice.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap-slider/slider.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/layui/css/layui.css" media="all">
    <style>
        .content {
            padding-bottom: 25px;
        }

        /*为select下拉框添加滚动条*/
        .layui-form-select dl {
            max-height: 200px;
        }

        /*使layui数据表格的checkbox居中*/
        .layui-table-cell .layui-form-checkbox[lay-skin="primary"] {
            top: 50%;
            transform: translateY(-50%);
        }

        /*layui数据表格自动换行*/
        /*     .layui-table-cell {
                 font-size: 14px;
                 padding: 0 5px;
                 height: auto;
                 overflow: visible;
                 text-overflow: inherit;
                 white-space: normal;
                 word-break: break-all;
             }*/

        /*更改layui原生样式*/
        .layui-layout-admin .layui-body {
            bottom: 0px;
        }

        .layui-show {
            height: 100%;
        }
    </style>
</head>

<body class="hold-transition skin-purple sidebar-mini">

<%--<div class="wrapper">--%>
<security:authentication property="principal.id" var="id"
></security:authentication>
    <!-- 页面头部 -->
    <jsp:include page="header.jsp"></jsp:include>
    <!-- 页面头部 /-->

    <!-- 导航侧栏 -->
    <jsp:include page="aside.jsp"></jsp:include>
    <!-- 导航侧栏 /-->

<!-- 内容区域 -->
<!-- @@master = admin-layout.html-->
<!-- @@block = content -->

<div class="content-wrapper" <%--style="margin-left: 0px;--%>>

    <!-- 内容头部 -->
    <section class="content-header">
        <h1>
            生产记录
            <%--<small>数据列表</small>--%>
        </h1>
        <ol class="breadcrumb">
            <li><a href="${pageContext.request.contextPath}/pages/main.jsp"><i class="fa fa-dashboard"></i> 首页</a>
            </li>
            <%--<li><a href="#">数据管理</a></li>--%>
            <li class="active">生产记录</li>
        </ol>
    </section>
    <!-- 内容头部 /-->

    <!-- 正文区域 -->
    <section class="content">

        <!-- .box-body -->
        <div class="box box-primary">

        </div>
        <div class="demoTable">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto" id="resetForm">
                <%--<div class="layui-form-item">--%>
                <security:authorize access="hasAnyRole('ROLE_SUPER_ADMIN,ROLE_ADMIN')">
                    <div class="layui-inline" style="width: 130px" id="projectDiv">
                        <select name="projectId" id="projectId" lay-filter="projectId">
                            <option disabled selected style='display:none;'>选择项目</option>
                        </select>
                    </div>
                    <div class="layui-inline" style="width: 130px" id="sectionDiv">
                        <select name="sectionId" id="sectionId" lay-filter="sectionId">
                            <option disabled selected style='display:none;'>选择标段</option>
                        </select>
                    </div>
                </security:authorize>
                <div class="layui-inline" style="width: 130px">
                    <select name="pileNum" id="pileNum">
                        <option value="" disabled selected hidden>选择设备</option>
                        <%--         <option value="1">成功</option>
                                 <option value="0">失败</option>--%>
                    </select>
                </div>
                <div class="layui-inline" style="width: 100px">
                    <select name="state" id="state">
                        <option value="" disabled selected hidden>预警状态</option>
                        <option value="1">正常</option>
                        <option value="0">预警</option>
                    </select>
                </div>


                <div class="layui-input-inline">
                    <input type="text" autocomplete="off" class="layui-input" id="start" name="start"
                           placeholder="开始日期">
                </div>
                <div class="layui-input-inline">
                    <input type="text" autocomplete="off" class="layui-input" id="end" name="end"
                           placeholder="结束日期">
                </div>
                <div class="layui-inline">
                    <input class="layui-input" autocomplete="off" name="stakeMark" id="stakeMark"
                           placeholder="请输入桩号">

                </div>

                <button class="layui-btn" data-type="reload"><i class="layui-icon layui-icon-search"></i></button>
                <button class="layui-btn" id="reset">重置</button>
                <div class="layui-inline">
                    <button type="button" class="layui-btn" style="width: 70px"
                            data-toggle="modal"
                            data-target="#myModal">
                        筛选
                    </button>
                </div>
                <div id="myModal" class="modal modal-primary" role="dialog">
                    <div class="modal-dialog modal-lg">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"
                                        aria-label="Close">
                                    <span aria-hidden="true">&times;</span></button>
                                <h4 class="modal-title">多条件组合筛选</h4>
                            </div>
                            <div class="modal-body">
                                <div class="box-body">
                                    <div class="form-horizontal" id="orgForm">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">施工桩长(m):</label>

                                            <div class="col-sm-5">
                                                <div class="input-group">
                                                    <input name="pileLength" id="pileLength" type="text"
                                                           class="form-control">
                                                    <span class="input-group-addon">-</span>
                                                    <input name="pileLength2" id="pileLength2" type="text"
                                                           class="form-control">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">平均灰量(kg/m)</label>

                                            <div class="col-sm-5">
                                                <div class="input-group">
                                                    <input name="aol" id="aol" type="text" class="form-control">
                                                    <span class="input-group-addon">-</span>
                                                    <input name="aol2" id="aol2" type="text" class="form-control">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">最大电流(A)</label>

                                            <div class="col-sm-5">
                                                <div class="input-group">
                                                    <input name="currentMax" id="currentMax" type="text"
                                                           class="form-control">
                                                    <span class="input-group-addon">-</span>
                                                    <input name="currentMax2" id="currentMax2" type="text"
                                                           class="form-control">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">成桩时间(s)</label>

                                            <div class="col-sm-5">
                                                <div class="input-group">
                                                    <input name="pileTime" id="pileTime" type="text"
                                                           class="form-control">
                                                    <span class="input-group-addon">-</span>
                                                    <input name="pileTime2" id="pileTime2" type="text"
                                                           class="form-control">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">桩长偏差(m)</label>

                                            <div class="col-sm-5">
                                                <div class="input-group">
                                                    <input type="text" class="form-control">
                                                    <span class="input-group-addon">-</span>
                                                    <input type="text" class="form-control">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">质量评级</label>
                                            <div class="col-sm-5">
                                                <div class="checkbox">
                                                    <select class="form-control" style="width: 150px"
                                                            name="grade"
                                                    >
                                                        <option selected value="">--请选择--</option>
                                                        <option value="A">A</option>
                                                        <option value="B">B</option>
                                                        <option value="C">C</option>
                                                        <option value="D">D</option>

                                                    </select>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>

                            </div>
                            <div class="modal-footer">
                                <button id="clear" type="button" class="btn btn-outline">
                                    重置
                                </button>
                                <%--<input type="reset"/>--%>
                                <button type="button" class="btn btn-outline" data-dismiss="modal">
                                    保存
                                </button>
                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>

                    <!-- /.modal-dialog -->
                </div>
                <%--</div>--%>
            </div>
        </div>
        <table class="layui-hide" id="test" lay-filter="test">

        </table>

        <script type="text/html" id="toolbarDemo">
            <%--<button class=" layui-icon-cols" lay-event="refresh">刷新</button>--%>
        </script>

        <script type="text/html" id="barDemo">
            <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="asd">删除</a>
        </script>
        <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
    </section>
    <!-- 正文区域 /-->

       </div>
    <!-- @@close -->
    <!-- 内容区域 /-->


</div>

<script src="${pageContext.request.contextPath}/plugins/layui/layui.js" charset="utf-8"></script>

<script src="${pageContext.request.contextPath}/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/adminLTE/js/app.min.js"></script>

<script>
    layui.config({
        dir: '/plugins/layui/'
        , version: false
        , debug: false
        , base: ''
    });
    //主体表格
    layui.use(['table', 'form', 'layer'], function () {
        var table = layui.table;
        var form = layui.form;
        var layer = layui.layer;
        table.render({
            elem: '#test'
            , url: '/cement/findAll.do'
            , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
            , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                , layEvent: 'LAYTABLE_TIPS'
                , icon: 'layui-icon-refresh'
            }]
            , totalRow: true
            , title: '生产记录'
            , skin: 'nob'
            , cols: [[
                {type: 'checkbox', field: 'checkbox', fixed: 'left'}
                // , {field: 'id', title: 'ID', width: 80, fixed: 'left', unresize: true, sort: true}
                , {field: 'device_code', title: '设备编号', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'pile_driver_num', title: '桩机号', hide: true, width: 120, edit: 'text', align: "center"}
                , {
                    field: 'stake_mark', title: '桩号', width: 250, align: "center", templet: function (res) {
                        return '<div><span>' + res.stake_mark + '</span><a href="javascript:void(0);" onclick="parameter(this)" class="layui-table-link" >[ 参数 |</a><a href="javascript:void(0);" onclick="playback(this)" class="layui-table-link"> 回放 ]</a></div>'
                    }
                }
                , {
                    field: 'start_date',
                    align: "center",
                    title: '开始时间',
                    width: 202,
                    edit: 'text',
                    templet: "<div>{{layui.util.toDateString(d.start_date, 'yyyy年-MM月-dd日 HH:mm:ss')}}</div>"
                }
                , {
                    field: 'end_date',
                    align: "center",
                    title: '结束时间',
                    width: 202,
                    edit: 'text',
                    templet: '#dateTpl'
                }
                , {field: 'pile_length', title: '施工桩长(m)', width: 170, edit: 'text', align: "center"}
                , {field: 'au_aol', title: '累计灰量', width: 180, edit: 'text', align: "center"}
                , {field: 'au_aoc', title: '累计浆量', width: 170, edit: 'text', align: "center"}
                , {field: 'cjsd', title: '初搅深度', width: 120, hide: true, edit: 'text', align: "center"}

                , {field: 'fjsd', title: '复搅深度', width: 120, hide: true, edit: 'text', align: "center"}
                , {field: 'water_cement_ratio', title: '水灰比', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'rih_av', title: '平均下钻速度', width: 120, edit: 'text', align: "center"}
                , {field: 'to_drill_av', title: '平均提钻速度', width: 120, edit: 'text', align: "center"}
                , {
                    field: 'average_aoc',
                    title: '平均浆量',
                    hide: true,
                    width: 120,
                    hide: true,
                    edit: 'text',
                    align: "center"
                }
                , {field: 'average_aol', title: '平均灰量', width: 120, edit: 'text', align: "center"}
                , {field: 'average_current', title: '平均电流', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'zdzs', title: '最大钻速', width: 120, hide: true, edit: 'text', align: "center"}
                , {field: 'zdts', title: '最大提速', width: 120, hide: true, edit: 'text', align: "center"}
                , {field: 'zdxd', title: '最大斜度', width: 120, hide: true, edit: 'text', align: "center"}
                , {field: 'pile_time', title: '成桩时间(s)', width: 120, edit: 'text', align: "center"}
                , {field: 'kdtzc', title: '扩大头桩长', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'kdthl', title: '扩大头灰量', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'kdtjl', title: '扩大头浆量', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'xbzjl', title: '下部桩浆量', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'xbzhl', title: '下部桩灰量', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'yjjb', title: '预警级别', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'xxx', title: '评级', hide: true, width: 120, edit: 'text', align: "center"}
                , {field: 'empty_stir_depth', title: '空搅深度', hide: true, width: 120, edit: 'text', align: "center"}
                , {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150}
            ]],
            done: function (res, curr, count) {
                //然后把值写上去td[data-field="itemNo" 定义在哪个列后显示
                this.elem.next().find('.layui-table-total td[data-field="checkbox"] .layui-table-cell').text("合计");

                this.elem.next().find('.layui-table-total td[data-field="stake_mark"] .layui-table-cell').text(res.totalPiles);
                this.elem.next().find('.layui-table-total td[data-field="pile_length"] .layui-table-cell').text(res.totalPileLength);
                this.elem.next().find('.layui-table-total td[data-field="au_aoc"] .layui-table-cell').text(res.sumAoc);
                this.elem.next().find('.layui-table-total td[data-field="au_aol"] .layui-table-cell').text(res.sumAol);
            }
            , page: true
            , id: 'testReload'
        });
        //条件查询重载表格
        var $ = layui.$, active = {
            reload: function () {
                var id = "${id}";
                var projectId = $('#projectId');
                var sectionId = $('#sectionId');
                var stakeMark = $('#stakeMark');
                var pileNum = $('#pileNum');
                var state = $('#state');
                var start = $('#start');
                var end = $('#end');
                var pileLength = $('#pileLength');
                var pileLength2 = $('#pileLength2');
                var aol = $('#aol');
                var aol2 = $('#aol2');
                var currentMax = $('#currentMax');
                var currentMax2 = $('#currentMax2');
                var pileTime = $('#pileTime');
                var pileTime2 = $('#pileTime2');
                //执行重载
                table.reload('testReload', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    , where: {
                        // key: {
                        userId: id,
                        projectId: projectId.val(),
                        sectionId: sectionId.val(),
                        stakeMark: stakeMark.val(),
                        pileNum: pileNum.val(),
                        state: state.val(),
                        start: start.val(),
                        end: end.val(),
                        pileLength: pileLength.val(),
                        pileLength2: pileLength2.val(),
                        aol: aol.val(),
                        aol2: aol2.val(),
                        currentMax: currentMax.val(),
                        currentMax2: currentMax2.val(),
                        pileTime: pileTime.val(),
                        pileTime2: pileTime2.val()
                        // }
                    }
                }, 'data');
            }
        };
        $('.demoTable .layui-btn').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
        //头工具栏事件
        table.on('toolbar(test)', function (obj) {
            var checkStatus = table.checkStatus(obj.config.id);
            switch (obj.event) {
                // case 'refresh':

                //自定义头工具栏右侧图标 - 提示
                case 'LAYTABLE_TIPS':
                    $(".layui-laypage-btn").click();
                    // layer.msg('刷新');
                    break;
                // break;
            }

        });
        form.on('select(projectId)', function (obj) {
            $.ajax({
                type: "get",
                url: "/section/sectionGroupName.do",
                data: {
                    projectId: obj.value
                },
                success: function (Data) {
                    // console.log(Data)
                    var section = $("#sectionDiv");
                    var html = "";
                    html += '<select name="sectionId" id="sectionId" lay-filter="sectionId">';
                    html += '<option value="" disabled selected hidden>选择设备</option>';
                    for (var i = 0; i < Data.length; i++) {
                        // console.log(Data[1])
                        html += '<option value="' + Data[i].id + '">' + Data[i].sectionName + '</option>';
                    }
                    html += '</select>';
                    section.html(html);
                    form.render('select');
                }
            });
        })
        //监听行工具事件
        table.on('tool(test)', function (obj) {
            var data = obj.data;
            //console.log(obj)
            if (obj.event === 'asd') {
                /* layer.confirm('真的删除行么', function (index) {
                     obj.del();
                     layer.close(index);
                 });*/
                layer.open({
                    type: 2,
                    content: 'http://sentsin.com' //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
                });
            } else if (obj.event === 'edit') {
                /*  layer.prompt({
                      formType: 2
                      , value: data.device_code
                  }, function (value, index) {
                      obj.update({
                          device_code: value
                      });
                      layer.close(index);
                  });*/
                layer.open({
                    type: 2,
                    title: '详细信息',
                    maxmin: true,
                    skin: 'layui-layer-lan',
                    shadeClose: true, //点击遮罩关闭层
                    area: ['1400px', '800px'],
                    offset: '100px',
                    content: '/pages/details.jsp', //弹框显示的url,对应的页面
                    /*   btn: ['综合版', '详细版']
                       , yes: function (index, layero) {
                           //按钮【按钮一】的回调
                           // layer.msg('hello');
                           //下载报表
                           location.href = "/data/excel/export.do";
                       }, btn2: function (index, layero) {
                           //按钮【按钮二】的回调
                           layer.msg('hello');
                           return false;
                           //开启该代码可禁止点击该按钮关闭
                       },*/
                    success: function (layero, index) {
                        var iframe = window['layui-layer-iframe' + index];
                        iframe.child(data, index);
                    }
                });
            }
        });
    });
    //日期
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        //日期时间选择器
        laydate.render({
            elem: '#start'
            , type: 'datetime'
        });
        laydate.render({
            elem: '#end'
            , type: 'datetime'
        });

    });
    $('#clear').on('click', function () {
        $(':input', '#orgForm')
            .not(":button", ":reset", "hidden", "submit")
            .val("")
            .removeAttr("checked")
            .removeAttr("selected");
    });
    //重置按钮
    layui.use('table', function () {
        var table = layui.table;
        $('#reset').on('click', function () {
            $(':input', '#resetForm')
                .not(":button", ":reset", "hidden", "submit")
                .val("")
                .removeAttr("checked")
                .removeAttr("selected");
            // $("#book")[0].reset();
            //执行重载
            table.reload('testReload', {
                page: {
                    curr: 1 //重新从第 1 页开始
                }
                , where: {
                    pileNum: "",
                    stakeMark: "",
                    start: "",
                    end: "",
                    pileLength: "",
                    pileLength2: "",
                    currentMax: "",
                    currentMax2: "",
                    aol: "",
                    aol2: "",
                    pileTime: "",
                    pileTime2: "",
                }
            }, 'data');
        });
    });
    //select下拉框获取数据
    layui.use('form', function () {
        var form = layui.form;
        var id = "${id}";
        var arr = [];
        $.post("/cement/selectBox.do", {}, function (data) {
            var carbrand = $("#pileNum"); //这里是<select>标签的id
            var opj = "";
            var list = data.list;
            for (var i = 0; i < list.length; i++) {
                // confirm(data[i])
                opj += "<option value='" + list[i] + "'>" + "双头搅拌桩记录仪" + list[i] + "号" + "</option>"
            }
            carbrand.append(opj);
            //渲染数据，没有这一步数据会加不上；
            form.render('select');
        });
        //获取标段列表
        $.ajax({
            type: "get",
            url: "/section/sectionGroupNameByUserId.do",
            data: {
                userId: id
            },
            success: function (Data) {
                // console.log(Data)
                var section = $("#section");

                // var html = "";

                for (var i = 0; i < Data.length; i++) {
                    // html += '<option value="' + Data[i].id + '">' + Data[i].sectionName + '</option>';
                    // console.log(Data[i].project_id)
                    arr.push(Data[i].project_id)
                }
                /*  section.append(html);
                  form.render('select');*/
                //获取项目列表
                $.ajax({
                    type: "get",
                    url: "/project/projectGroupName.do",
                    traditional: true,//这条必须加上，否则传不了数组
                    data: {
                        projectIds: arr
                    },
                    success: function (Data) {
                        // console.log(Data)
                        var project = $("#projectId");
                        var html = "";
                        for (var i = 0; i < Data.length; i++) {
                            html += '<option value="' + Data[i].id + '">' + Data[i].projectName + '</option>';
                        }
                        project.append(html);
                        form.render('select');
                    }
                });
            }
        });


    })

    function parameter(obj) {
        var stakeMark = $(obj).parent().find('span').html();
        layer.alert(stakeMark);
    }

    function playback(obj) {
        var stakeMark = $(obj).parent().find('span').html();
        layer.open({
            type: 2,
            title: '运行状况',
            maxmin: true,
            skin: 'layui-layer-lan',
            shadeClose: true, //点击遮罩关闭层
            area: ['1300px', '800px'],
            content: 'playback.jsp', //弹框显示的url,对应的页面
            success: function (layero, index) {
                var iframe = window['layui-layer-iframe' + index];
                iframe.child(stakeMark, index);
            }
        });
    }


    //汽车品牌 下拉框


    /* $(document).ready(function () {
         // 选择框
         // $(".select2").select2();

         // WYSIHTML5编辑器
       /*  $(".textarea").wysihtml5({
               locale: 'zh-CN'
           });
     });*/


    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }


    $(document).ready(function () {

        // 激活导航位置
        setSidebarActive("admin-datalist");

        // 列表按钮
        /* $("#dataList td input[type='checkbox']").iCheck({
             checkboxClass: 'icheckbox_square-blue',
             increaseArea: '20%'
         });
         // 全选操作
         $("#selall").click(function () {
             var clicks = $(this).is(':checked');
             if (!clicks) {
                 $("#dataList td input[type='checkbox']").iCheck("uncheck");
             } else {
                 $("#dataList td input[type='checkbox']").iCheck("check");
             }
             $(this).data("clicks", !clicks);
         });*/
    });

</script>
<script type="text/html" id="dateTpl">
    {{#
    if(d.end_date){}}
    {{layui.util.toDateString(new Date(d.end_date).getTime(), "yyyy年-MM月-dd日 HH:mm:ss") }}
    {{#}
    else{}}

    {{#}}}
</script>
</body>

</html>
